<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        <div class="layui-form-item">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-block">
                <input type="radio" name="type" value="0" title="新增拼团" lay-filter="type" checked>
                <!--                <input type="radio" name="type" value="1" title="拼团订单" lay-filter="type" style="display: none">-->
            </div>
        </div>
        <div class="layui-form-item" id="goods">
            <label class="layui-form-label">拼团产品</label>
            <div class="layui-input-block">
                <select name="goods_id" data-select="{:url('mall.goods/choseGoods')}"
                        data-fields="id,title" data-value="">
                </select>
            </div>
        </div>
        <div class="layui-form-item" id="order" style="display: none">
            <label class="layui-form-label">拼团订单</label>
            <div class="layui-input-block">
                <select name="collage_id" data-select="{:url('mall.order/getCollage')}"
                        data-fields="collage_id,goods_name" data-value="">
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">虚拟人数</label>
            <div class="layui-input-block">
                <input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="person_number"
                       class="layui-input"
                       placeholder="请输入虚拟人数" value="1">
            </div>
        </div>
        <div class="hr-line"></div>

        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>
    </form>
</div>
<script>
    layui.use('form', function () {
        var form = layui.form;
        form.on('radio(type)', function (data) {
            console.log(1111, data.value)
            if (data.value == 0) {
                $("#goods").show();
                $("#order").hide();
            } else if (data.value == 1) {
                $("#goods").hide();
                $("#order").show();
            }
        });
    })
</script>